import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager

driver=webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get("http://8.137.19.140:9090/blog_login.html")
#登陆
driver.find_element(By.CSS_SELECTOR,"#username").send_keys("lisi")
driver.find_element(By.CSS_SELECTOR,"#password").send_keys("123456")
driver.find_element(By.CSS_SELECTOR,"#submit").click()

time.sleep(2)

#检查用户昵称
txt=driver.find_element(By.CSS_SELECTOR,"body > div.container > div.left > div > h3").text
print(txt)##lisi
# #检查头像
driver.find_element(By.CSS_SELECTOR,"body > div.container > div.left > div > img")
# #检查标题
driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div:nth-child(1) > div.title")
# #检查内容
driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div:nth-child(1) > div.desc")
# #检查“查看全文”
driver.find_element(By.CSS_SELECTOR,"body > div.container > div.right > div:nth-child(1) > a")

driver.quit()

# DSFDFFFFDFDSCCXXVXVVERTEERRTETJHMHFFDFDREJGHG